<template>
	<view class="searchList">
		<!-- 搜索栏 -->
		<view class="searchHeader padding25">
			<fui-search-bar class='fuiSearch' :paddingLr="0"  radius='36' inputBackground="rgba(224, 224, 224, 0.3)"
			 background="rgba(0,0,0,0)" :showLabel='false' cancelColor='#e2e2e2' searchColor='#e2e2e2' placeholder='输入关键字/景点/位置等' @search="goSearch"></fui-search-bar>
		</view>
		<view class="searchContent padding25">
			<!-- 定位城市 v-if="pageNum == '1'"-->
			<!-- <view class="searchCity grey font26" >
				<view class="grey  font26" >
					我的位置
				</view>

				<view class="Dark cityDark font28" @click="positionA" v-if="address">
					{{address}}
				</view>
				<view class="Dark cityDark font28"  @click="positionA" v-else>
					微山岛
				</view>
			</view> -->
			<!-- 历史记录 -->
			<!-- <view class="historyAll">
				<view class="searchHistory grey font26">
					历史记录
					<view class="historyClear" @click="clearClick">
						清空
						<image class="clearPn" :src="baseOssUrl + 'icon/clear.png'" mode=""></image>
					</view>
				</view>
				<view class="Dark historyDark font28" v-for="item in hotsList">
					{{item}}
				</view>
			</view> -->
			<!-- 热门景区/美食 -->
			<!-- <view class="hotSpots grey font26">
				<view class="grey  font26">
					热门搜索
				</view>
				<view class="Dark hotDark font28" v-for="item in hotsList">
					{{item}}
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	import {
		baseOssUrl
	} from '@/common/settings';
	export default {
		data() {
			return {
				baseOssUrl: baseOssUrl,
				hotsList: ['微子wwwww林', '微子林', '微子林', '微子ww林', '微子林', '微子wwwww林', ],
				address:'',
				searchValue:'',
				pageNum:''
				
			}
		},
		onLoad(op) {
		  console.log("22",op)
		 this.pageNum = op.num
		},
		created() {

		},
		methods: {
			goSearch(e){
			  console.log(e.detail.value)
			  this.searchValue = e.detail.value
			  uni.navigateTo({
			  	url: "/pages/hotel/index?searchValue="+this.searchValue
			  })
			},
			clearClick() {},
			 
			positionA() {
				let _this =this
				wx.chooseLocation({
					success(res) {
						// console.log('11222', res)
						_this.address = res.name 
					},
					fail(res) {
						console.log('erro', res)
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.searchList {
		height: 100%;

		.searchHeader {
			background-color: #FFFFFF;
			margin-bottom: 24rpx;
		}

		.searchContent {
			background: #FFFFFF;
			padding-top: 25rpx;
			overflow: hidden;
			height: calc(100vh - 150rpx);

			// 定位城市
			.searchCity {
				overflow: hidden;

				.cityDark {
					margin: 24rpx 0;
					padding: 5rpx 10rpx;
					border: 1px solid #DBDCDB;
					margin: 20rpx 20rpx 5rpx 0;
					float: left;
				}
			}

			// 搜索历史
			.historyAll {
				overflow: hidden;

				.searchHistory {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-top: 40rpx;

					.historyClear {
						display: flex;
						justify-content: center;
						align-items: center;

						.clearPn {
							padding-left: 7rpx;
							width: 25rpx;
							height: 28rpx;
						}
					}

				}
			}

			.historyDark {
				margin: 20rpx 20rpx 5rpx 0;
				padding: 5rpx 10rpx;
				border: 1px solid #DBDCDB;
				float: left;
			}

			.hotSpots {
				overflow: hidden;

				.grey {
					margin-top: 30rpx;
				}

				.hotDark {
					float: left;
					margin: 20rpx 20rpx 5rpx 0;
					padding: 5rpx 10rpx;
					border: 1px solid #DBDCDB;
				}

			}
		}
	}
</style>
